﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.ComponentModel;
using System.Windows.Controls;
using Microsoft.Windows.Controls;
using MockupDesigner.Editors.TextEditors;

namespace MockupDesigner.Items
{
    [CalendarEditor]
    public class CalendarItem : ResizableItem
    {
        public override Size GetPreferredSize()
        {
            return new Size(180, 160);
        }

        private DateTime displayDate = new DateTime(2000, 1, 1);
        [Category("Prop_Content")]
        public DateTime DisplayDate
        {
            get { return this.displayDate; }
            set
            {
                if (this.DisplayDate == value) return;
                OnPropertyChanging("DisplayDate", this.DisplayDate, value);
                this.displayDate = value;
                ((this.Content as Viewbox).Child as Calendar).DisplayDate = value;
                ((this.Content as Viewbox).Child as Calendar).SelectedDate = value;
                OnPropertyChanged("DisplayDate");
            }
        }
    }
}
